<?php
    require ( 'init.inc.php' );
    require ( 'checkadmin.inc.php');
    require ( __COMM_PATH . 'select.inc.php' );

    $Action =  $_GET['Action'];
    $xSelect = $_GET['xSelect'];

    if($xSelect == 'Save'){
        switch($Action){
            case 'Products_Voltage':
                $Products_Voltage = $_POST['Products_Voltage'];
                //$Products_Voltage = nl2br($Products_Voltage);
                $Products_Voltage = str_replace("\r",'',$Products_Voltage);
                $Products_Voltage = str_replace("\n",'||',$Products_Voltage);
                break;
            case 'Products_Condition':
                $Products_Condition = $_POST['Products_Condition'];
                $Products_Condition = str_replace("\r",'',$Products_Condition);
                $Products_Condition = str_replace("\n",'||',$Products_Condition);
                break;
        }

        #[写入信息]
        $msg = "<?"."php\n";
        $msg.= "#[定义相关列表信息]\n";
        $msg.= "\$Products_Voltage = \"".$Products_Voltage."\";\n";
        $msg.= "\$Products_Condition = \"".$Products_Condition."\";\n";
        $msg.= "\$AuthorConf = \"广州网站建设-思盾信息技术有限公司【WEB新势力】-www.68web.net\";\n";
        $msg.= "?>";
        MakeFile(__COMM_PATH . 'select.inc.php' , $msg);
        $script_str = 'window.close(); opener.location.reload();';
        doJS($script_str);
        exit;
    }

    switch($Action){
       case 'Products_Voltage':
           $PageName = 'Rated Voltage';
           $FormName = $Action;
           $FormContent = str_replace('||',"\n",$Products_Voltage);
           break;
       case 'Products_Condition':
           $PageName = 'Condition 3';
           $FormName = $Action;
           $FormContent = str_replace('||',"\n",$Products_Condition);
           break;
    }

    
    echo"<html>
        <head>
        <meta http-equiv=Content-Type content=text/html; charset=utf-8>
        <title>添加列表</title>
        <link href=Design.css rel=stylesheet TYPE=text/css>
        </head>
        <body bgColor=menu topmargin='0'>
        <TABLE WIDTH='350'  BORDER='0' ALIGN='center' cellpadding='0' CELLSPACING='0'>
        <Form method='post' action='Select.php?xSelect=Save&Action=". $Action ."'>
        <TR>
        <TD>
        <fieldset>
        <legend>" .$PageName. "</legend>
        <TABLE WIDTH='350'  BORDER='0' ALIGN='center' cellpadding='0' CELLSPACING='0'>
        <TR>
        <TD HEIGHT=5></TD>
        </TR>
        <TR>
        <TD ALIGN='center'>
        <TEXTAREA NAME='".$FormName."' rows='8' cols='44' CLASS='submit_all'>" .$FormContent. "</TEXTAREA></TD>
        </TR>
        <TR>
        <TD HEIGHT=5></TD>
        </TR>
        </TABLE>
        </fieldset>
        </TD>
        </TR>
        <TR>
        <TD HEIGHT='40' ALIGN='right'>
        <INPUT NAME='提交' TYPE=submit CLASS='Wenben' id=Ok VALUE=保存列表>　
        <INPUT TYPE=button CLASS='Wenben' onclick='window.close();' VALUE='  取消  '></TD>
        </TR>
        </form>
        <TR>
        <TD HEIGHT='1' bgcolor='#666666'></TD>
        </TR>
        <TR>
        <TD HEIGHT='5'></TD>
        </TR>
        <TR>
        <TD>
        添加时请用回车分开，请勿输入“||”字符。<br>        
        </TD>
        </TR>
        </TABLE>
        </body>
        </html>"
?>
